package com.common.model;


import java.sql.Timestamp;
import java.util.List;

import com.teacher.model.ProjAndProf;
import com.teacher.util.StringUtils;

/**
 * 题目的java bean，用于与数据库中字段相对应，
 * 便于持久层进行调用
 * @author XHFSJ
 *
 */
public class Project {

	/**
	 * 尚未审核
	 */
	public static final String NOT_AUTH = "NOT_AUTH";
	/**
	 * 通过审核
	 */
	public static final String PASSED = "PASSED";
	/**
	 * 审核失败
	 */
	public static final String AUTH_FAILED = "AUTHERIC_FAILED";
	/**
	 * 题目编号
	 */
	private Integer id;
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * 论文提交路径
	 */
	private String commitmentsPath;
	/**
	 * 题目描述，包括题目简介、要求等
	 */
	private String description;
	/**
	 * 论文最终路径
	 */
	private String essayPath;
	/**
	 * 题目名称
	 */
	private String name;
	/**
	 * 备注
	 */
	private String remark;
	/**
	 * 题目状态，如未审核、审核通过、审核失败等
	 */
	private String status;
	/**
	 *选择该题目的学生编号
	 */
	private Integer stu_id;
	
	/**
	 * 发布题目的老师编号
	 */
	private Integer tea_id;
	/**
	 * TeacherUser对象，引用com.comon.model.TeacherUser类
	 * 用于在Mybatis中进行级联查询
	 */
	private TeacherUser teacher;
	/**
	 * 发布题目的老师的基本信息
	 * 由Mybatis中采用级联查询而得
	 */
	private StudentUser student;
	
	/**
	 * 题目与可选专业信息
	 */
	private List<ProjAndProf> profs;
	
	private Timestamp publish_date;
	
	private Boolean enableUp;
	
	private String attach_file;
	
	private String shenghe_fail_reason;
	
	private Integer shengyue_tea_id;
	
	private TeacherUser shengyue_teacher;
	
	private String shengyue_fail_reason;
	
	private Boolean shengyue_status;
	
	private String taskBook;
	
	private Score score;
	
	public Score getScore() {
		return score;
	}
	public void setScore(Score score) {
		this.score = score;
	}
	public String getTaskBook() {
		return taskBook;
	}
	public void setTaskBook(String taskBook) {
		this.taskBook = taskBook;
	}
	public String getShenghe_fail_reason() {
		return shenghe_fail_reason;
	}
	public void setShenghe_fail_reason(String shenghe_fail_reason) {
		this.shenghe_fail_reason = shenghe_fail_reason;
	}
	public Integer getShengyue_tea_id() {
		return shengyue_tea_id;
	}
	public void setShengyue_tea_id(Integer shengyue_tea_id) {
		this.shengyue_tea_id = shengyue_tea_id;
	}
	public String getShengyue_fail_reason() {
		return shengyue_fail_reason;
	}
	public void setShengyue_fail_reason(String shengyue_fail_reason) {
		this.shengyue_fail_reason = shengyue_fail_reason;
	}
	public Boolean getShengyue_status() {
		return shengyue_status;
	}
	public void setShengyue_status(Boolean shengyue_status) {
		this.shengyue_status = shengyue_status;
	}
	public String getAttach_file() {
		return attach_file;
	}
	public void setAttach_file(String attach_file) {
		this.attach_file = attach_file;
	}
	public Boolean getEnableUp() {
		return enableUp;
	}
	public void setEnableUp(Boolean enableUp) {
		this.enableUp = enableUp;
	}
	public Timestamp getPublish_date() {
		return publish_date;
	}
	public void setPublish_date(Timestamp publish_date) {
		this.publish_date = publish_date;
	}
	public List<ProjAndProf> getProfs() {
		return profs;
	}
	public void setProfs(List<ProjAndProf> profs) {
		this.profs = profs;
	}
	public TeacherUser getTeacher() {
		return teacher;
	}
	public void setTeacher(TeacherUser teacher) {
		this.teacher = teacher;
	}
	public StudentUser getStudent() {
		return student;
	}
	public void setStudent(StudentUser student) {
		this.student = student;
	}
	
	public String getCommitmentsPath() {
		return commitmentsPath;
	}
	public void setCommitmentsPath(String commitmentsPath) {
		this.commitmentsPath = commitmentsPath;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getEssayPath() {
		return essayPath;
	}
	public void setEssayPath(String essayPath) {
		this.essayPath = essayPath;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getStatus() {
//		return StringUtils.propertyToStatus(status);
		return status;
	}
	
	public String getFormatStatus(){
		return StringUtils.propertyToStatus(status);
	}
	public void setStatus(String status) {
		if(!(status.equals(AUTH_FAILED)||status.equals(NOT_AUTH)||status.equals(PASSED)))
			throw new IllegalArgumentException("parameter error!");
		this.status = status;
	}
	public Integer getStu_id() {
		return stu_id;
	}
	public void setStu_id(Integer stu_id) {
		this.stu_id = stu_id;
	}
	public Integer getTea_id() {
		return tea_id;
	}
	public void setTea_id(Integer  tea_id) {
		this.tea_id = tea_id;
	}
	public TeacherUser getShengyue_teacher() {
		return shengyue_teacher;
	}
	public void setShengyue_teacher(TeacherUser shengyue_teacher) {
		this.shengyue_teacher = shengyue_teacher;
	}
	@Override
	public String toString() {
		return "Project [id=" + id + ", description=" + description + ", name="
				+ name + ", remark=" + remark + ", status=" + status
				+ ", stu_id=" + stu_id 
				+ ", tea_id=" + tea_id + "]";
	}
	
}
